package com.project.slsx.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.project.slsx.R;
import com.project.slsx.bean.CashGoodsListBean;
import com.project.slsx.utils.GlideUtils;

public class ReaultAdapter extends BaseQuickAdapter<CashGoodsListBean.ResultBean, BaseViewHolder> {
    public ReaultAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder holder, CashGoodsListBean.ResultBean item) {
        ImageView ivCategory = holder.getView(R.id.iv_category);
        RequestOptions option = GlideUtils.getOption();
        Glide.with(mContext)
                .load(item.getThumb())
                .apply(option)
                .into(ivCategory);

        holder.setText(R.id.tv_cash_goods_name, item.getTitle());
        holder.setText(R.id.tv_cash_goods_price, item.getPrice());
        holder.setText(R.id.tv_cash_goods_total, item.getTotal());
    }
}
